﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MySpiderMgr.Domain.Common;
using MySpiderMgr.Domain.Common.Dtos;
using MySpiderMgr.Services.Common;

namespace MySpiderMgr.WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SysSequenceController : ControllerBase
    {
        readonly ISequenceService _SequenceService;
        public SysSequenceController(ISequenceService sequenceService)
        {
            this._SequenceService = sequenceService;
        }
        [HttpGet]
        public ActionResult<List<SysSequence>> Get()
        {
            return _SequenceService.FindSysSequences(null);
        }
        [HttpPost]
        [Route("api/SysSequence/Add")]
        public void Add(CreateSysSequenceDto dto)
        {
            _SequenceService.Add(dto);
        }
        [HttpPost]
        public void Modify(ModifySysSequenceDto dto)
        {
            _SequenceService.Modify(dto);
        }
    }
}